﻿using System.Web.Mvc;

namespace MvcShop.MVC.Areas.Users
{
    public class UsersAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Users";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
               "Users_Orders",
               "Users/{controller}/{action}/{billNo}",
               new { controller = "UsersOrders", action = "OrdersHandle", billNo = "" },
               new { controller = @"^\w+", action = @"^\w+", billNo = @"^[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}$" }
           );

            context.MapRoute(
                "Users_default",
                "Users/{controller}/{action}/{id}",
                new { action = "Index", id = "" }
            );
        }
    }
}
